# __init__.py 为初始化加载文件
import time

from .controller import Controller

controller = Controller()

# controller.go_mall()
# print("任务完成")
# time.sleep(60)

# 打开抖音
controller.start_dy()

while True:
    if controller.next_index == 1 and controller.is_task_list():
        print("=========[sign]=========")
        controller.next_index = 2
        controller.sign()
        time.sleep(3)

    if controller.next_index == 2 and controller.is_task_list():
        print("=========[reservation]=========")
        controller.next_index = 3
        controller.reservation()
        time.sleep(3)

    if controller.next_index == 3 and controller.is_task_list():
        print("=========[receive_]=========")
        controller.next_index = 4
        controller.receive_()
        time.sleep(3)

    if controller.next_index == 4 and controller.is_task_list():
        print("=========[open_box]=========")
        controller.next_index = 5
        controller.open_box()
        time.sleep(3)

    if controller.next_index == 5 and controller.is_task_list():
        print("=========[go_shopping]=========")
        controller.next_index = 6
        controller.go_shopping()
        time.sleep(3)

    if controller.next_index == 6 and controller.is_task_list():
        print("=========[go_island]=========")
        controller.next_index = 7
        controller.go_island()
        time.sleep(3)

    if controller.next_index == 7 and controller.is_task_list():
        print("=========[go_novel]=========")
        controller.next_index = 8
        controller.go_novel()
        time.sleep(3)

    if controller.next_index == 8 and controller.is_task_list():
        print("=========[open_box2]=========")
        controller.next_index = 9
        controller.open_box2()
        time.sleep(3)

    if controller.next_index == 9 and controller.is_task_list():
        print("=========[receive_red]=========")
        controller.next_index = 10
        controller.receive_red()
        time.sleep(3)

    if controller.next_index == 10 and controller.is_task_list():
        print("=========[listening_book]=========")
        controller.next_index = 11
        controller.listening_book()
        time.sleep(3)

    if controller.next_index == 11 and controller.is_task_list():
        print("=========[go_mall]=========")
        controller.next_index = 12
        controller.go_mall()
        time.sleep(3)

    if controller.next_index == 12 and controller.is_task_list():
        print("=========[send_present]=========")
        controller.next_index = 1
        controller.send_present()
        time.sleep(3)

    # 做完一轮任务
    controller.do_round()






